﻿ var imgva="";
function Show(tp)
{
 if(tp==0)
 {
 showProgressBar(true);
 top.location="/teach/default.htm?s=3";
 }else  if(tp==2)
 {
    $('stu').style.display="none";
     $('Tea').style.display="";
 }
 else
 {
   $('stu').style.display="";
   $('Tea').style.display="none"; 
 }
}
function IMchange(id)
{
$('IMValue').value=imlist[id.value-1];
}
function SaveStep(im)
{ 
imgva=im; 
document.getElementsByName("Form1")[0].action ="/teach/default.htm";
   document.getElementsByName("Form1")[0].submit; 
$('SGender').style.display='none';
$('SIntroduction').style.display='none';
var Introduction=$('Introduction').value;
    if(!$ValidButton$()||($('Gender1').checked==false&&$('Gender2').checked==false)||Introduction.length<1||Introduction.length>1000)
    {
       if($('Gender1').checked==false&&$('Gender2').checked==false)
        {
            $('SGender').style.display='';
            $('Gender').className="validatorCalloutHighlight";
         }
         if(Introduction.length<1||Introduction.length>1000)
         {
          $('SIntroduction').style.display='';
         }
        return;
    }
    showProgressBar(true);
    var Gender="0";
if($('Gender1').checked)
{
  Gender="1";  
}
var BOD=BODID.value;
var IsShowBod=true;
if($('ShowBodID').checked)
{
IsShowBod=false
}
    WebServices.My.UpdateStep1(memberno, $('TargetLanguage').value, $('TargetLanguageLevel').value, Gender, BOD, $('Country').value, $('IMType').value, $('IMValue').value, $('TimeZone').value, Introduction, IsShowBod,onners)
}
function onners(re)
{

  if(re) 
  { if(imgva=="")
    {
    top.location="/user/active_step2.htm";
    }else
    {
      top.location="/user/ActiveComplete.htm?setp=2";  
    }
  } 
  else
  {$get("MessagesBox").style.display='';}
  showProgressBar(false);
}
